<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<BreukenWebsite.Models.Opdracht>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Opdrachten
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        $(document).ready(function() {
            $("#myTable").tablesorter();
        });
    </script>
    <h2>Opdrachten</h2>
    
    <table id="myTable" class="tablesorter">
    <thead>
        <tr>
            <th>
            </th>
            <th>
                Datum
            </th>
            <th>
                Moeilijkheidsgraad
            </th>
            <th>
                Maximumscore
            </th>
            <th>
                Status
            </th>
            <th>
                Details
            </th>
            <th>
                Leerlingen
            </th>
            <th>
                Opgaven
            </th>
            <th>
                Delete
            </th>
        </tr>
    </thead>
    <tbody>
    <% foreach (var opdracht in Model)
       { %>
    
        <tr>
            <td>
                <%= Html.Encode(opdracht.opdrachtID)%>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", opdracht.opdrachtDatum.ToShortDateString()))%>
            </td>
            <td>
                <%= Html.Encode(opdracht.moeilijkheidsGraad)%>
            </td>
            <td>
                <%= Html.Encode(opdracht.maxScore)%>
            </td>
            <td>
                <%= Html.Encode(opdracht.status)%>
            </td>
            <td>
                <%= Html.ActionLink("_IMG_", "Details", new { id = opdracht.opdrachtID }).Replace("_IMG_", "<img alt=\"Details\" src=\"../../Content/icons/search.png\"/>")%>
            </td>
            <td>
                <%= Html.ActionLink("_IMG_", "OpdrachtAddLeerlingen", new { id = opdracht.opdrachtID }).Replace("_IMG_", "<img alt=\"Voeg Leerlingen Toe\" src=\"../../Content/icons/user_add.png\"/>")%>
            </td>
            <td>
                <%= Html.ActionLink("_IMG_", "OpdrachtAddOpdrachtDetail", new { id = opdracht.opdrachtID }).Replace("_IMG_", "<img alt=\"Voeg Opgave Toe\" src=\"../../Content/icons/add.png\"/>")%>
            </td>
            <td>
                <%= Html.ActionLink("_IMG_", "Delete", new { id = opdracht.opdrachtID }).Replace("_IMG_", "<img alt=\"Verwijderen\" src=\"../../Content/icons/remove.png\"/>")%>
            </td>
        </tr>
    
    <% } %>
    </tbody>
    </table>

    <p>
        <%= Html.ActionLink("_IMG_", "CreateOpdracht").Replace("_IMG_", "<img alt=\"Opdracht Aanmaken\" src=\"../../Content/icons/database_add.png\"/> Opdracht Aanmaken")%>
    </p>

</asp:Content>

